import request from '@/utils/request';

// 获取列表
export const reqRoleList =(params)=>request({url:`/system/role/`,method:'get',params});
// 获取角色列表
export const reqAllRoles=(data)=>request({url:`/system/roleList/`,method:'get',data});
// 获取角色信息
export const reqRoleInfo =(id)=>request({url:`/system/role/${id}/`,method:'get'});

// 根据角色获取菜单
export const reqRolePermission = (roleId)=>request({url:`/system/role/${roleId}/permission/`,method:'get'});

// 增加和更新
export const reqAddOrUpdateRole = (data)=>{
	if(data.id){
		return request({url:`/system/role/${data.id}/`,method:'patch',data})
	}else{
		return request({url:'/system/role/',method:'post',data})
	}
}
// 删除单个角色
export const reqRemoveRole = (id)=>request({url:`/system/role/${id}/`,method:'delete'});

